#单词计数
count=0
with open("D:\\test1.py") as f:
    for lien in f:
        count+=lien.count("itheima")
print(f"itheima出现了{count}次")

with open("D:\\test1.py") as f:
    print("itheima出现了:",f.read().count("itheima"),"次")

with open("D:\\test1.py") as f:
    print("itheima出现了:",str(f.readlines()).count("itheima"),"次")

